<?php
namespace app\admin\controller\auth;

use support\Request;
use app\admin\service\auth\MenuService;


class MenuController 
{
    public function list(Request $request)
    {
      $jwt = $request->jwt;
      $service = new MenuService();
      return $service->getList($jwt);
    }
    public function edit(Request $request)
    {
      $data = $request->all();
      $service = new MenuService();
      $id = $data['id'];
      unset($data['id']);
      return $service->Edit($id, $data);
    }
    public function add(Request $request)
    {
      $data = $request->all();
      $service = new MenuService();
      return $service->Add($data);
    }
    public function del(Request $request)
    {
      $data = $request->all();
      $ids = is_array($data['ids']) ? $data['ids'] : explode(',', $data['ids']);
      $service = new MenuService();
      return $service->Delete($ids);
    }

}
